class Solution:
    def countAsterisks(self, s: str) -> int:
        count = 0
        start_flag = False

        for c in s:
            if start_flag:
                if c == '|':
                    start_flag = False
            else:
                if c == '|':
                    start_flag = True
                elif c == '*':
                    count += 1

        return count


print(Solution().countAsterisks('yo|uar|e**|b|e***au|tifu|l'))
